1. Field of the Invention
The present invention relates to a floating point operation system, and more particularly, to a floating point operation system in a processor. Although the present invention can be used for a wide range of applications including both integer and floating point operations, the invention is especially useful for floating point operations and will be explained with particular attention to them.
2. Discussion of the Related Art
Microprocessors today have taken the math computational ability to the next performance level by using an on-chip floating point unit. Such microprocessors include the x86 family of processors from Intel Corp. Through such features as instruction scheduling and pipelined execution, the floating point unit is capable of executing two floating point instructions in a single clock. For example, incorporated into the unit is a sophisticated eight-stage pipelining. The first four states are similar to integer pipelines while the final four stages consist of a two-stage floating point execute, rounding and writing of the result to the register file, and error reporting. In addition, common floating point functions, such as add, multiply, and divide, are hardwired for faster execution.
One of the features of the inherited x86 architecture, however, is the organization of floating point registers as a stack, which means that direct register references cannot be made. Most accesses therefore must use the top of stack, wherever it is, as an operand. For example, if neither operand is at the top of the stack (TOS), an exchange operation must first be made to place one of the operands at the top of the stack.
The exchange operation presents a problem because unlike most other instructions, the exchange operation reads and writes two registers. To do the exchange, data bits in the physical registers of the stack must be shuffled around. Even for the case where one operand is at the top of the stack, the entire data bits of three registers must be moved--top of stack register, stack register to be exchanged with the top of stack register, and a temporary register. Instead of a temporary register, a technique of writing two locations simultaneously can be used which would require additional wiring between the registers. Thus, even though there is no computation in an exchange operation, two clocks are used to perform the operation. Moreover, a temporary register is also needed to complete the operation. Thus, the conventional technique of executing the exchange operation requires too much time as well as a large number of data lines.